package com.example.lvsuo.controller.cxg;


import com.example.lvsuo.entity.cxg.AdmExpressage;
import com.example.lvsuo.entity.cxg.vo.AdmExpressageVo;
import com.example.lvsuo.modal.Result;
import com.example.lvsuo.service.cxg.IAdmExpressageService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * 收件/发件 管理  Controller
 *
 * @author 心心念念
 * @since 2021-03-30
 */
@RestController
@RequestMapping("/admExpressage")
public class AdmExpressageController {

@Autowired
    IAdmExpressageService expressageService;


@GetMapping
    public Result quertAdmExpressageSJ(AdmExpressageVo admExpressageVo){
//    System.out.println("接受的数据有:"+admExpressageVo);
    PageHelper.startPage(admExpressageVo.getPageCur(),admExpressageVo.getPageSize());

    PageInfo pageInfo = new PageInfo(expressageService.quertAdmExpressageSJ(admExpressageVo));

    return Result.back("ok","20000",pageInfo);
}

@GetMapping("/{id}")
    public Result queryByid(@PathVariable String id){

    AdmExpressageVo expressageVo = expressageService.queryByid(id);

    return  Result.back("ok","20000",expressageVo);
}


}

